Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API endpoint for getting UserProfile by username #105

Merged
merged 5 commits into from
Nov 7, 2023

Conversation

jonkjetiloye
Copy link
Member

@jonkjetiloye jonkjetiloye commented Oct 31, 2023

Description

Adds a new API controller to altinn-profile with endpoint for internal use (from e.g. Authorization) for lookup of UserProfile:
POST profile/api/v1/internal/user/

which takes in a new UserProfileLookup model where one of the available user identifiers:
UserId
Username
SSN (or Dnr)

must be provided for performing the lookup of UserProfile for a given user.

New service and client implementation has been added for lookup by username which consumes the newly added SBL bridge API:
/sblbridge/profile/api/users/?username={username}

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

#104
Adds an API endpoint in altinn-profile:
profile/api/v1/users/?username={username}

which consumes the newly added SBL bridge API:
/sblbridge/profile/api/users/?username={username}

if (!response.IsSuccessStatusCode)
{
_logger.LogError("Getting user {username} failed with {statusCode}", username, response.StatusCode);

Check failure

Code scanning / CodeQL

Log entries created from user input High

This log entry depends on a
user-provided value
.
Copy link

sonarcloud bot commented Nov 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@acn-sbuad acn-sbuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎈

@jonkjetiloye jonkjetiloye merged commit d2d226b into main Nov 7, 2023
8 of 9 checks passed
@jonkjetiloye jonkjetiloye deleted the feature/104-APIGetUserProfileByUsername branch November 7, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants